<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
</head>
<body>

<div id="box">
    <input type="button" @click="add" value="添加"/>
    <ul>
        <li v-for="item in myData">
            {{item}}
        </li>
    </ul>
</div>

<script>
    new Vue({
        data: {
            myData: ['apple','pear','orange']
        },
        methods: {
            add: function () {
                this.myData.push('tomato');
            }
        }
    }).$mount("#box")
</script>
</body>
</html>